package homwork;

import java.util.Scanner;

public class Snake {
    public static void main(String[] args) {
        System.out.println("请输入一个蛇形名");
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        System.out.println("转为驼峰后：" + snakeToCamel(str));
    }

    public static String snakeToCamel(String str) {
        String str2 = "";
        String[] str1 = str.split("");
        for (int i = 0; i < str1.length; i++) {
            if (str1[i].equals("_")) {
                str1[i] = "";
                str1[i + 1] = str1[i + 1].toUpperCase();
            }
        }
        for (String items : str1) {
            str2 += items;

        }
        return str2;
    }
}
